<!DOCTYPE html>
<html lang="zh-CN">

<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <meta http-equiv="X-UA-Compatible" content="ie=edge">
    <title>Document</title>
    <script src="../js/vue.js"></script>
    <script src="../js/axios.min.js"></script>
    <link rel="stylesheet" href="../css/bootstrap.min.css">
</head>

<body>
<div id="app" >
    <table class="table table-hover">
        <caption>京淘电商平台</caption>
        <thead>
            <tr>
                <th>标题</th>
                <th>卖点</th>
                <th>价格</th>
            </tr>
        </thead>
        <tbody>
            <tr v-for="o in msg">
                <td>{{o.title}}</td>
                <td>{{o.sellPoint}}</td>
                <td>{{o.price}}</td>
            </tr>
        </tbody>
    </table>

</div>

<script>
    var vm = new Vue({
        el: '#app',
        data: {
            msg: "hi vue"
        },
        mounted() {
            axios({
                method: "post",
                url: "http://localhost:8080/item/list?num=3"
            })
            .then(
                //res==response
                res =>{
                    // console.log(res.data)
                    this.msg =res.data;
                }
            )
        },
        methods: {}
    });
</script>
</body>

</html>